<!DOCTYPE html>
<html>
<head>
  <title>表单</title>
  {include file="public/head" /}
</head>
<body>
<div class="wrapper" >

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" style="background: #fff;">
 

    <!-- Main content -->
    <section class="content container-fluid" >

      <div class="row" >
        <div class="col-xs-12">
             <!-- form start -->
            <form id="adminForm" action="{:url('AdminUser/userEdit')}" class="form-horizontal">
              <input type="hidden" name="admin_id" value="{$admin.admin_id}">
              <div class="box-body">
                <div class="form-group">
                  <label for="admin_name" class="col-xs-2 control-label">管理员账号</label>
                  <div class="col-xs-10">
                    <input type="text" class="form-control" name="admin_name" value="{$admin.admin_name}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="role" class="col-xs-2 control-label">角色组</label>
                  <div class="col-sm-10">
                    {volist name="role" id="vo"}
                    <div class="col-xs-4">{$vo.group_name}</div>&nbsp;&nbsp;&nbsp;&nbsp;
                    {/volist}
                  </div>
                </div>
                <div class="form-group">
                  <label for="realname" class="col-xs-2 control-label">管理员姓名</label>
                  <div class="col-xs-10">
                    <input type="text" class="form-control" name="realname" value="{$admin.realname}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="Mobile" class="col-xs-2 control-label">手机号码</label>
                  <div class="col-xs-10">
                    <input type="text" class="form-control" name="mobile" value="{$admin.mobile?$admin.mobile:''}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="email" class="col-xs-2 control-label">邮箱</label>
                  <div class="col-xs-10">
                    <input type="text" class="form-control" name="email" value="{$admin.email}">
                  </div>
                </div>

                <div class="box-footer">
                  <!--<button type="submit" class="btn btn-default">Cancel</button>-->
                  <button type="button" class="btn btn-info pull-right">确定修改</button>
                </div>

                <div class="box box-success" style="margin-top: 30px">
                <div class="form-group" style="margin-top: 10px;color: green">
                  <label for="role" class="col-xs-2 control-label">拥有权限</label>
                </div>
                <div class="form-group">

                    {volist name="powers" id="vo"}
                    <div class="form-group" style="margin-left: 15px;font-size: 12px">
                      <label for="inputPassword3" class="col-sm-2 control-label">{$vo.menu_name}</label>
                      <div class="col-sm-10 mailbox-messages" style="margin-left: 15px;">
                        <table class="table table-hover table-striped">
                          <tbody>
                          {volist name="vo.child" id="v"}
                          <tr style="padding-left: 100px">
                            <th class="col-xs-4" style="color: #666;">{$v.menu_name}</th>
                            <td>
                              {volist name="v.child" id="val"}<span class="col-xs-4"> value="{$val.menu_name}"</span>{/volist}
                          </tr>
                          {/volist}
                          </tbody>
                        </table>
                      </div>
                    </div>
                    {/volist}
                  </div>
                </div>
              </div>

            </form>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
</div>
<!-- ./wrapper -->
{include file="public/js" /}
<script type="text/javascript">
    function confirm() {
        return $("#adminForm").serialize();
    }

    //修改个人信息
    $('.btn-info').click(function () {
        $.post("{:url('AdminUser/userEdit')}",$("#adminForm").serialize(),function(res){
              layer.msg(res.msg,{time:2000},function(index, layero){
                  parent.layer.closeAll();
              });

        }, "json");
    });
</script>
</body>
</html>